package com.yk.faceapplication.util;

import android.text.InputFilter;
import android.text.Spanned;

public class InputFilterX implements InputFilter {


    @Override
    public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
        try {
            if(dest.toString().length() + source.toString().length() > 18){
                return "";
            }
            if (source.toString().equals("x")) {
                return "X";
            }
            return null;
        } catch (NumberFormatException nfe) {
        }
        return "";
    }

}